package com.example.helloworld;

import java.util.HashMap;

public class HashMapTest {
    public static void main(String[] args) {
        HashMap<Integer, String> map = new HashMap<>();
        map.put(1, "One");
        map.put(2, "Two");
        map.put(3, "Three");
        map.put(4, "Four");
        System.out.println(map);
        map.remove(2);
        System.out.println(map);
        System.out.println(map.size());
        System.out.println("-----------");
        for (int key : map.keySet()) {
            System.out.println(key + " : " + map.get(key));
        }

        for (String value : map.values()) {
            System.out.println(value);
        }
    }
}
